﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<Defect_Tracking_System.Models.GroupListModel>" %>

<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
<div id="page-heading">
	<h1>Groups List</h1>
</div>
<!-- end page-heading -->

<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="/Content/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="/Content/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner ...................................................................... START -->
    
	    <div id="content-table-inner">
		<!--  start table-content  -->
		<div id="table-content">
        <div style="margin-bottom: 20px">
        <form action="/Group/Index/1" method="get">
            <input type="text" onkeyup="searchGroup(this)" name="keyWord" id="keyWord" size="30" value="<%: Model.KeyWord %>" onfocus="if(this.value=='Search Group') this.value=''" onblur="if(this.value=='') this.value='Search Group'" />
            <button type="submit" id="find">Find</button>
        </form>
        </div>
        <form action="/Group/DeleteGroup?PageIndex=<%: Model.PageIndex %>&keyWord=<%: Model.KeyWord %>" name="formMain" method="post">
			<table border="0" width="100%" cellpadding="0" cellspacing="0" class="product-table">
			<tr>
				<th class="table-header-check"></th>
				<th class="table-header-repeat line-left minwidth-1"><a href="#">Group Name</a>	</th>
				<th class="table-header-repeat line-left"><a href="#">Number Of Member</a></th>
                <th class="table-header-repeat line-left"><a href="#">Number Of Project</a></th>
				<th class="table-header-repeat line-left"><a href="#">Nubmer Of Defect</a></th>
				<th class="table-header-repeat line-left"><a href="#">Total Attachment Size</a></th>
                <th class="table-header-repeat line-left"><a href="#">Created Date</a></th>
                <th class="table-header-repeat line-left"><a href="#">Creator</a></th>
                <th class="table-header-options line-left"><a href="#">Options</a></th>
			</tr>
            <% foreach(Defect_Tracking_System.Models.GroupModel group in Model.Groups){ %>
			<tr id="<%: group.GroupId %>">
				<td><input  type="checkbox" name="GroupId" value="<%: group.GroupId %>"/></td>
				<td><%: group.GroupName%></td>
				<td><%: group.NumberOfMember%></td>
				<td><%: group.NumberOfProject%></td>
                <td><%: group.NumberOfDefect %></td>
				<td><%: group.TotalAttachmentSize%>kb</td>
                <td><%: group.CreatedDate %></td>
				<td><%: group.Creator%></td>
				<td class="options-width">
                <% if (group.IsActive)
                   { %>
                    <a href="/Group/EnableDisableGroup?id=<%: group.GroupId %>&act=Disable&pageIndex=<%: Model.PageIndex %>&keyWord=<%: Model.KeyWord %>" title="Disable this group" class="icon-close info-tooltip"></a>
                <% }
                   else
                   { %>
                    <a href="/Group/EnableDisableGroup?id=<%: group.GroupId %>&act=Enable&pageIndex=<%: Model.PageIndex %>&keyWord=<%: Model.KeyWord %>" title="Enable this group"class="icon-open info-tooltip"></a>
                <% } %>
                    <%--<a href="/Group/DeleteGroup?id=<%: group.GroupId %>&PageIndex=<%: Model.PageIndex %>" onclick="return confirm('Are you sure to delete this group?')" title="Delete" class="icon-2 info-tooltip"></a>--%>
				</td>
			</tr>
         <% } %>
			</table>
        </form>
			<!--  end product-table................................... --> 
		</div>
		<!--  end content-table  -->
		<!--  start paging..................................................... -->
		<table border="0" cellpadding="0" cellspacing="0" id="paging-table">
		<tr>
		<td>
            <div id="PageNavigator">
                <% if (Model.HasPrevious)
                   {%>
                        <a href="/Group/Index/1" class="page-far-left"></a>
                        <a href="/Group/Index/<%: Model.PageIndex - 1 %>" class="page-left"></a> 
                     <% } %>
                <div class="page-info">Page <strong><%: Model.PageIndex %></strong> / <%: Model.TotalPages %></div>
                <% if (Model.HasNext)
                   {%>
                        <a href="/Group/Index/<%: Model.PageIndex + 1 %>" class="page-right"></a>
                        <a href="/Group/Index/<%: Model.TotalPages %>" class="page-far-right"></a>
                 <%}%>
            </div>
		</td>
		</tr>
		</table>
		<!--  end paging................ -->
		<div class="clear"></div>
	</div>
	<!--  end content-table-inner ............................................END  -->
	</td>
	<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>
</asp:Content>

<asp:Content ID="Footer" ContentPlaceHolderID="Fotter" runat="server">
<img src="/Content/images/shared/loading51.gif" id="loading" style="display: none" />
<script type="text/javascript" src="/Scripts/GroupIndex.js"></script>
</asp:Content>
